package cn.com.twoke.easyproject.aspect.request.lock.hook.after;

import cn.com.twoke.easyproject.aspect.request.lock.RequestLock;
import cn.com.twoke.easyproject.common.utils.ServletUtils;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;

/**
 * 给生成的请求锁key添加请求地址
 */
@Slf4j
public class GenerateKeyAfterWithRequestPath implements GenerateKeyHook {

    @Override
    public String doAfter(String key, ProceedingJoinPoint joinPoint, RequestLock requestLock) {
        return ServletUtils.getRequest().getRequestURI() + key;
    }

}
